home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SampleSBP2.h
-
- Contains: Definitions for use with sample SBP-2 expert/family
-
- Version: 1.0
-
- Copyright: © 1998-1999 by Apple Computer, Inc., all rights reserved.
-
- File Ownership:
-
- DRI: Eric Anderson
-
- Other Contact:
-
- Technology: FireWire
-
- Writers:
-
- (EA) Eric Anderson (ewa)
-
- Change History (most recent first):
-
- <FW8> 1/10/99 EA Added support for testing cable power management API.
- <FW7> 1/3/99 EA Changed CSRUniqueID to CSRNodeUniqueID. Somehow it got lost in
- the checkin. Twice.
- <FW6> 1/1/99 EA Added fields to SBPQueryLoginsParamsStruct to help test
- FWGetFWReferenceIDFromUniqueID.
- <FW5> 12/31/98 EA Added support for Query Logins.
- <FW4> 12/31/98 EA Added support for sending a TARGET RESET management ORB.
- <FW3> 11/18/98 EA Added LUN value to status call.
- <FW2> 9/20/98 EA Filled in header comments.
- <FW1> 9/20/98 EA first checked in
- */
-
-
- #ifndef __SampleSBP2__
- #define __SampleSBP2__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
- #ifndef __NAMEREGISTRY__
- #include <NameRegistry.h>
- #endif
-
- #include <FireWire.h>
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Sample SBP family typedefs.
- //
-
- typedef struct OpaqueSBPClientID* SBPClientID;
- typedef struct OpaqueSBPDriverID* SBPDriverID;
-
- enum
- {
- kInvalidSBPClientID = 0,
- kInvalidSBPDriverID = 0
- };
-
- enum
- {
- kNdrvTypeIsSampleSBP2 = 'SSBP'
- };
-
- enum
- {
- // Apple event class for Sample SBP family.
- kAESampleSBP2EventClass = 'SSBP',
-
- // Apple events sent by Sample SBP family.
- kAESampleSBP2DeviceAdded = 'ADDD',
- kAESampleSBP2DeviceRemoved = 'RMVD',
-
- // Parameters used by Sample SBP family Apple events.
- kAESBPDriverIDKey = 'DRID',
- kAESBPDriverIDType = typeLongInteger //zzz should we have our own???
- };
-
- struct SBPInterfaceParamsStruct
- {
- UInt32 interfaceSelector;
- };
- typedef struct SBPInterfaceParamsStruct
- SBPInterfaceParams,
- *SBPInterfaceParamsPtr;
-
- typedef OSErr
- (SBPInterfaceProc) (
- SBPInterfaceParamsPtr pInterfaceParams);
- typedef SBPInterfaceProc *SBPInterfaceProcPtr;
-
- enum
- {
- cscSBPCommand = 2
- };
-
- enum
- {
- kSampleSBPLogin = 1,
- kSampleSBPLogout = 2,
- kSampleSBPQueryLogins = 3,
- kSampleSBPStatus = 4,
- kSampleSBPStatusInquiry = 5,
- kSampleSBPModeSense = 6,
- kSampleSBPReadBlock = 7,
- kSampleSBPTargetReset = 8,
- kSampleSBPPowerTest = 9
- };
-
- struct SBPGenericParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- Ptr responseBufferPtr;
- UInt32 responseBufferSize;
- };
- typedef struct SBPGenericParamsStruct
- SBPGenericParams,
- *SBPGenericParamsPtr;
-
- struct SBPInitializeParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- RegEntryID *pDriverRegEntry;
- };
- typedef struct SBPInitializeParamsStruct
- SBPInitializeParams,
- *SBPInitializeParamsPtr;
-
- struct SBPTerminateParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- RegEntryID *pDriverRegEntry;
- };
- typedef struct SBPTerminateParamsStruct
- SBPTerminateParams,
- *SBPTerminateParamsPtr;
-
- struct SBPLoginParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- Ptr responseBufferPtr;
- UInt32 responseBufferSize;
- OSStatus status;
- };
- typedef struct SBPLoginParamsStruct
- SBPLoginParams,
- *SBPLoginParamsPtr;
-
- struct SBPLogoutParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- OSStatus status;
- };
- typedef struct SBPLogoutParamsStruct
- SBPLogoutParams,
- *SBPLogoutParamsPtr;
-
- struct SBPStatusParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- Boolean login;
- Boolean reconnecting;
- Boolean reconnectFailed;
- UInt32 notificationCounter;
- UInt32 notificationEvent;
- UInt32 notificationLength;
- Ptr notificationMessage;
- UInt32 lun;
- };
- typedef struct SBPStatusParamsStruct
- SBPStatusParams,
- *SBPStatusParamsPtr;
-
- struct SBPQueryLoginsParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- UInt32 response[64];
- OSStatus status;
- FWReferenceID fwReferenceID;
- CSRNodeUniqueID uniqueID;
- OSStatus uniqueIDStatus;
- };
- typedef struct SBPQueryLoginsParamsStruct
- SBPQueryLoginsParams,
- *SBPQueryLoginsParamsPtr;
-
- struct SBPStatusInquiryParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- OSStatus status;
- };
- typedef struct SBPStatusInquiryParamsStruct
- SBPStatusInquiryParams,
- *SBPStatusInquiryParamsPtr;
-
- struct SBPModeSenseParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- OSStatus status;
- };
- typedef struct SBPModeSenseParamsStruct
- SBPModeSenseParams,
- *SBPModeSenseParamsPtr;
-
- struct SBPReadBlockParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- OSStatus status;
- };
- typedef struct SBPReadBlockParamsStruct
- SBPReadBlockParams,
- *SBPReadBlockParamsPtr;
-
- struct SBPTargetResetParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- OSStatus status;
- };
- typedef struct SBPTargetResetParamsStruct
- SBPTargetResetParams,
- *SBPTargetResetParamsPtr;
-
- struct SBPPowerTestParamsStruct
- {
- SBPInterfaceParams sbpInterfaceParams;
- OSStatus status;
- };
- typedef struct SBPPowerTestParamsStruct
- SBPPowerTestParams,
- *SBPPowerTestParamsPtr;
-
-
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Sample SBP family services.
- //
-
- OSStatus RegisterSBPClientApplication (
- SBPClientID *pSBPClientID,
- UInt32 clientContextData);
-
- OSStatus UnregisterSBPClientApplication (
- SBPClientID sbpClientID);
-
- OSStatus GetSBPDriverList (
- SBPDriverID *pSBPDriverIDList,
- UInt32 sbpDriverIDListSize,
- UInt32 *pNumSBPDrivers);
-
- OSStatus CallSBPDriver (
- SBPDriverID sbpDriverID,
- SBPInterfaceParamsPtr pInterfaceParams);
-
- OSStatus OpenSBPDriver (
- SBPDriverID sbpDriverID);
-
- OSStatus CloseSBPDriver (
- SBPDriverID sbpDriverID);
-
- OSStatus GetNextSBPClientEvent (
- SBPClientID sbpClientID);
-
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __SampleSBP2__ */
-